CROSS_COMPILE := arm-linux-
CC := $(CROSS_COMPILE)gcc

ROOTFS := /home/chzhou/code/2440/rootfs
CP_DIR := $(ROOTFS)/bin

all: user_mode_gpio user_mode_i2c install

user_mode_gpio: user_mode_gpio.c
	$(CC) -o $@ $<

user_mode_i2c: user_mode_i2c.c
	$(CC) -Os -o $@ $<

install:
	cp user_mode_gpio $(CP_DIR)
	cp user_mode_i2c $(CP_DIR)

uninstall:
	rm $(CP_DIR)/user_mode_gpio
	rm $(CP_DIR)/user_mode_i2c
		
clean:
	rm -fr user_mode_gpio user_mode_i2c

